import { Inject, Injectable } from '@nestjs/common';
import { PrismaService } from '@/prisma/prisma.service';
import AdminLoginDto from '@/dto/AdminLogin.dto';

@Injectable()
export class AdminUserService {
  @Inject(PrismaService)
  private prisma: PrismaService;

  async login(userInfo: AdminLoginDto) {
    const { username, password } = userInfo;
    const user = await this.prisma.adminUser.findFirst({
      where: {
        username,
        password,
      },
    });
    return user;
  }
}
